﻿<!DOCTYPE html>
<html lang="zh">

<head resource>
    <meta charset="utf-8">
    <include file="../inc/meta.inc" />
    <title></title>
</head>

<body>
    <div id="vapp" v-cloak>
        <div class="toolsbar">
            <btngroup show="新增" ref='btngroup' path="Modify" width="800" height="600" idkey='Exam_ID' table="datatable"
                :modal="true"></btngroup>
            <query_panel :model="form" :loading="loading" @search="handleCurrentChange(1)">
                <el-form-item label="">
                    <el-date-picker v-model="selectDate" type="daterange" align="right" unlink-panels
                        style="width: 220px;" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
                        :picker-options="pickerOptions" :default-time="['00:00:00', '23:59:59']">
                    </el-date-picker>
                </el-form-item>
                <el-form-item label="">
                    <el-input v-model="form.search" placeholder="考试主题" style="width:160px"> </el-input>
                </el-form-item>
            </query_panel>
        </div>
        <template>
            <el-table ref="datatable" :data="datas" tooltip-effect="dark" :stripe="true" style="width: 100%"
                index-key="Exam_Tax" row-key="Exam_ID" @row-click.self="clickTable">
                <el-table-column type="index" width="50">
                    <template slot-scope="scope">
                        <span>{{(form.index - 1) * form.size + scope.$index + 1}}</span>
                    </template>
                </el-table-column>
                <el-table-column type="expand" remark="考试场次">
                    <template slot-scope="scope">
                        <exams :uid="scope.row.Exam_UID" :theme="scope.row"></exams>
                    </template>
                </el-table-column>
                <el-table-column label="考试主题">
                    <template slot-scope="scope">
                        <useicon :state="scope.row.Exam_IsUse"
                            @change="(state)=>{scope.row.Exam_IsUse=state;changeState(scope.row);}">
                        </useicon>
                        <span v-html='scope.row.Exam_Title' class="large"></span>
                    </template>
                </el-table-column>
                <el-table-column label="时间设定" width="100" align="center">
                    <template slot-scope="scope">
                        <span v-if="scope.row.Exam_DateType==1">定时开始</span>
                        <span v-if="scope.row.Exam_DateType==2">时间区间</span>
                    </template>
                </el-table-column>
                <el-table-column label="考试时间" width="120" align="center">
                    <template slot-scope="scope">
                        <span v-if="scope.row.Exam_DateType==1"> {{scope.row.Exam_Date|date('yyyy-MM-dd HH:mm')}}</span>
                        <span v-if="scope.row.Exam_DateType==2">
                            {{scope.row.Exam_Date|date('yyyy-MM-dd HH:mm')}} 至
                            {{scope.row.Exam_DateOver|date('yyyy-MM-dd HH:mm')}}
                        </span>

                    </template>
                </el-table-column>
                <el-table-column label="参考人次" width="100" align="center">
                    <template slot-scope="scope">
                        <attend :exam="scope.row"></attend>
                    </template>
                </el-table-column>
                <el-table-column label="参考人员">
                    <template slot-scope="scope">
                        <group :exam="scope.row"></group>
                    </template>
                </el-table-column>
                <el-table-column label="管理" width="120" align="center">
                    <template slot-scope="scope">
                        <el-link type="primary" plain icon="el-icon-edit"
                            @click.stop='$refs.btngroup.modify(scope.row.Exam_ID)'>
                            修改
                        </el-link>
                        <el-popconfirm confirm-button-text='是的' cancel-button-text='不用' icon="el-icon-info"
                            icon-color="red" title="确定删除吗？" @confirm="deleteExam(scope.row)">
                            <el-link type="danger" plain icon="el-icon-delete" slot="reference" @click.native.stop>删除
                            </el-link>
                        </el-popconfirm>
                    </template>
                </el-table-column>
            </el-table>

        </template>
        <div id="pager-box">
            <el-pagination v-on:current-change="handleCurrentChange" :current-page="form.index" :page-sizes="[1]"
                :page-size="form.size" :pager-count="12" layout="total, prev, pager, next, jumper" :total="total">
            </el-pagination>
        </div>
    </div>
</body>

</html>